<?php
session_start();
require_once('../../execute/inc/config.inc');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
	die('Failed to connect to server: ' . mysql_error());
}

//Select database
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
	die("Unable to select database");
}

$qry = @mysql_query("UPDATE perm_members SET 
					firstname = '".$_POST['firstname']."', 
					lastname = '".$_POST['lastname']."',
					email = '".$_POST['emailid']."',
					bio = '".$_POST['bio']."',
					gender = '".$_POST['gender']."',
					phone = '".$_POST['phone']."',
					address = '".$_POST['address']."'      
					WHERE id ='".$_SESSION['SESS_USER_ID']."'");
if($qry){
	header("Location: ../profile.php?update=success");
}
else{
	header("Location: ../profile.php?update=fail");
}
?>